<template>
  <div>
    兄弟A

    <button @click="fun()">点击传递数据</button>
    <hr>
    <h1>{{funs }}</h1>
    <h1>{{this.$store.getters.texts}}</h1>
    <div>异步请求

    </div>
  </div>
</template>

<script>
import eventBus from "@/eventBus/index.js"


export default {

  data () {
    return {
      text:"数据A"
    }
  },
  computed:{
    funs(){
      return this.$store.state.text
    }
  },
  methods:{
    fun(){
      eventBus.$emit("eventbus",this.text)
    }
  },
  created(){
    this.$store.dispatch("action")
  }
}
</script>

<style>

</style>